package jodd.example.action;

import java.util.List;
import jodd.example.model.Message;
import jodd.example.service.AppService;
import jodd.madvoc.meta.Action;
import jodd.madvoc.meta.MadvocAction;
import jodd.madvoc.meta.Out;
import jodd.petite.meta.PetiteInject;

@MadvocAction
public class IndexAction {

    @PetiteInject
    AppService appService;

    @Out
    List<Message> messages;

    @Action(alias = "index")
    public void view() {
        messages = appService.findLastMessages(10);
    }
}